package com.fsxgt.datagrid.console.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.fsxgt.datagrid.console.bo.FlowExecLogBO;
import com.fsxgt.datagrid.console.page.PageParam;
import com.fsxgt.datagrid.console.service.impl.JobService;
import com.fsxgt.datagrid.core.utils.ReturnT;
import com.fsxgt.datagrid.flow.service.impl.FlowMenuService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Api(tags = "任务接口", value = "JobController")
@RequestMapping(produces = "application/json; charset=UTF-8",path = "/log")
@RestController
public class LogController extends BaseController {

	@Autowired
	private JobService jobService;
	@Autowired
	private FlowMenuService flowMenuService;
	
	

	
	@ApiOperation(hidden = true, value = "分页查询", notes = "")
	@RequestMapping(path = "/findLogPage", method = RequestMethod.POST)
    public ReturnT findJobPage(@RequestBody PageParam<FlowExecLogBO> pageParam) {
		
		PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize());
		
		List<FlowExecLogBO> list=jobService.findLogPage(pageParam.getParam());
		
		PageInfo<FlowExecLogBO> pageInfo = new PageInfo<>(list);
		
        return new ReturnT(pageInfo);
    }
    
	

}